package day12_coll.demo02_TreeSet;

public class Student implements Comparable {
    @Override
    public int compareTo(Object o) {
        return -1;//返回值为0时 表示相同
        //返回值为正数时 表示插入的大于原本的数据，正序
        //返回值为负数时 表示插入的小于原本的数据，倒序
    }
    private String name;
    private int age;

    public Student() {
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }



}
